/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ten;

import java.math.BigInteger;
/**
 *
 * @author shikefu678
 */
public class Problem10 {

    public static void main(String args[]) {
        Result res = new Result();
        System.out.print(res.sum());
    }
    
}

class Result{
    public BigInteger sum(){
        BigInteger a = new BigInteger("2000000");
        BigInteger b = BigInteger.valueOf(3);
        BigInteger sum = BigInteger.valueOf(2);
        while(b.compareTo(a) == -1){
            if(b.isProbablePrime(2)){
                sum.add(b);
            }
            b.add(BigInteger.valueOf(2));
        }
        return sum;
    }
}
